﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DTO;
using BUS;

namespace QuanLySach
{
    public partial class frmChuongTrinh : Form
    {
        public static int dem = 0;
        public frmChuongTrinh()
        {
            InitializeComponent();
        }

        private void tsmiQLSach_Click(object sender, EventArgs e)
        {
            frmQLSach fqlsach = new frmQLSach();
            fqlsach.MdiParent = this;
            fqlsach.Show();
        }

        private void tsmiQLKhachHang_Click(object sender, EventArgs e)
        {
            frmQLKhachHang fqlkhachhang = new frmQLKhachHang();
            fqlkhachhang.MdiParent = this;
            fqlkhachhang.Show();
        }

        private void tsmiQLTonKho_Click(object sender, EventArgs e)
        {
            frmQLTonKho fqltonkho = new frmQLTonKho();
            fqltonkho.MdiParent = this;
            fqltonkho.Show();
        }

        private void tsmiQLCongNo_Click(object sender, EventArgs e)
        {
            frmQLCongNo fqlcongno = new frmQLCongNo();
            fqlcongno.MdiParent = this;
            fqlcongno.Show();
        }

        public void frmChuongTrinh_FormClosing(object sender, FormClosingEventArgs e)
        {
            DialogResult drDong = MessageBox.Show("Thoát Chương Trình", "Thông báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (drDong == DialogResult.Yes)
            {
                //add code cap nhat
                e.Cancel = false;
                //dn.Show();
            }
            //else if (drDong == DialogResult.No)
            //{
            //    e.Cancel = false;
            //}
            else
            {
                e.Cancel = true;
            }
        }

        private void frmChuongTrinh_Load(object sender, EventArgs e)
        {
        }
    }
}
